package com.example.idachuappone.index.entity;

import java.io.Serializable;
import org.json.JSONObject;

public class CommentUser implements Serializable {
    private String area;
    private int degree;
    private String name;
    private String uid;

    public CommentUser parseJson(JSONObject json) {
        if (json == null) {
            return null;
        }
        if (json.has("uid")) {
            this.uid = json.optString("uid");
        }
        if (json.has("name")) {
            this.name = json.optString("name");
        }
        if (json.has("degree")) {
            this.degree = json.optInt("degree");
        }
        if (!json.has("area")) {
            return this;
        }
        this.area = json.optString("area");
        return this;
    }

    public String getUid() {
        return this.uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getArea() {
        return this.area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public int getDegree() {
        return this.degree;
    }

    public void setDegree(int degree) {
        this.degree = degree;
    }
}
